﻿@model IEnumerable<BillBox.Models.Bill>
@{
    ViewBag.Title = "Payment History";
    Layout = "~/Views/Shared/_Layout.cshtml";

    var previous = ViewBag.Previous as Nullable<int>;
    var next = ViewBag.Next as Nullable<int>;
}


<div class="row main">
    <div class="col-lg-12">
        <ol class="breadcrumb">
            <li>@Html.ActionLink("Home", "Index", "Default")</li>
            <li><a href="#">Payment</a></li>
            <li class="active">History</li>
        </ol>
        <div class="panel panel-default">
            <div class="panel-heading">
                Payment History
            </div>
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th>@Html.DisplayNameFor(b => b.FirstOrDefault().BillId)</th>
                                <th>@Html.DisplayNameFor(b => b.FirstOrDefault().Subscriber)</th>
                                <th>@Html.DisplayNameFor(b => b.FirstOrDefault().Agent)</th>
                                <th>@Html.DisplayNameFor(b => b.FirstOrDefault().AgentBranchId)</th>
                                <th>@Html.DisplayNameFor(b => b.FirstOrDefault().User)</th>
                                <th>@Html.DisplayNameFor(b => b.FirstOrDefault().Date)</th>
                                <th>&nbsp;</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (BillBox.Models.Bill bill in Model)
                            {
                                <tr>
                                    <td><a href="@Url.Action("ViewReceipt", new { billId = @bill.BillId })" target="_blank">@bill.BillId.ToString()</a></td>
                                    <td>@bill.Subscriber.Name</td>
                                    <td>@bill.Agent.Name</td>
                                    <td>@bill.AgentBranch.Name</td>
                                    <td>@bill.User.Name</td>
                                    <td>@bill.Date</td>
                                    <td>
                                        @Html.ActionLink("View", "ViewBill", "Payment", new { billId = @bill.BillId }, null)
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- /.panel-body -->
            <div class="panel-footer">
                @Html.Partial("_Pager")
            </div>
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>
